import React from 'react';
import logo from './logo.svg';
import './App.css';
class Heads extends React.Component{
  constructor(props){
    super(props)
  }
  render(){
    return(
      <div>
        <h3>头部</h3>
        <p>{this.props.na}</p>
      </div>
    )
  }
}
class App extends React.Component{
  static defaultPrpps={
    name:"哈哈"
  }
  constructor(props){
    super(props)
    this.state={
      txt:"hello world"
    }
    this.fn=this.fn.bind(this)
  }
  render(){
    console.log(this)
    return(
      <div>
        <Heads na={this.state.txt}/>
        <h3 onClick={this.fn}>1807</h3>
      </div>
    )
  }
  fn(ev){
    console.log(ev.target)
  }
}

export default App;
